package com.jasonchoi.eurekaconsumer.consume;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * Spring Cloud 远程调用方式之一 ribbon + restTemplate
 * @Author: JasonChoi
 * @Date: 2019/12/30 11:26
 */
@Component
public class HelloRibbonConsumer {

    @Autowired
    RestTemplate restTemplate;

    public String hello(String name) {
        return restTemplate.getForObject("http://EUREKAPRODUCT/hello?name="+name,String.class);
    }

}
